<%@ page contentType="text/html;charset=UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5shiv.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css"/>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="static/vant/index.css">
    <link rel="stylesheet" href="static/element/index.css">
    <!--[if IE 6]>
    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title></title>
    <style>

        * {
            padding: 0;
            margin: 0;
        }

        html {
            overflow-y: hidden;
        }

        body, html {
            width: 100%;
            height: 100%;
        }

        body {
            display: flex;
            flex-flow: column;
        }

        .fheader {
            min-height: 40px;
            padding: 0;
            margin: 0;
            display: flex;
            flex-flow: row;
        }

        .fsection {
            display: flex;
            flex-flow: row;
            min-height: 0;
        }

        .farticle {
            flex: 1;
            padding: 1px;
            height: 100%;
            overflow: scroll;
            float: left;
            overflow-x: hidden;
        }

        .el-table__body tr:hover > td {
            background-color: #DFDFDF !important;
            cursor: default
        }

        .el-table__cell {
            padding: 5px 0 !important;
        }

        .fail .layui-layer-content {
            background-color: brown;
            color: #eee;
            width: 400px;
            height: 24px;
            text-align: center;
        }

        .succeed .layui-layer-content {
            background-color: #0061A8;
            color: #eee;
            width: 400px;
            height: 24px;
            text-align: center;
        }

        .mytitle {
            height: 40px;
            width: 100%;
            display: flex;
            flex-flow: row;
        }

        .curr {
            flex: 1;
            line-height: 40px;
            display: flex;
            align-items: center;
            padding-left: 10px;
        }

        .count {
            line-height: 40px;
            width: 160px;
            text-align: center;
            border-left: 1px solid #ddd;
            color: brown;
        }

    </style>
</head>
<body>
<div id="app">
    <div class="fheader">
        <div class="mytitle">
            <div class="curr"><a href="javascript:" class="btn btn-primary radius" id="add"><i class="Hui-iconfont">&#xe600;</i>
                新增</a></div>
            <div class="count">总记录数：{{iiCount}}</div>
        </div>
    </div>

    <div class="fsection">
        <div class="farticle">
            <el-table ref="members" :data="tableData" stripe border style="width: 100%" :height="tableHeightL"
                      empty-text="没有数据"
                      :header-cell-style="tableHeaderCellStyleL" :cell-style="tableCellStyleL">
                <el-table-column prop="VALUE01" label="流水号" width="60"></el-table-column>
                <el-table-column prop="VALUE02" label="名称" width="120"></el-table-column>
                <el-table-column prop="VALUE03" label="有效时长(月)" width="100"></el-table-column>
                <el-table-column prop="VALUE04" label="食堂消费率" width="90"></el-table-column>
                <el-table-column prop="VALUE05" label="超市消费率" width="90"></el-table-column>
                <el-table-column prop="VALUE06" label="管理类型" width="80"></el-table-column>
                <el-table-column prop="VALUE07" label="押金/工本费）金额" width="150"></el-table-column>
                <el-table-column prop="VALUE08" label="个人最大允许持卡张数" width="160"></el-table-column>
                <el-table-column prop="VALUE09" label="月限额" width="80"></el-table-column>
                <el-table-column prop="VALUE10" label="限额策略" width="80"></el-table-column>
                <el-table-column prop="VALUE11" label="创建时间" width="150"></el-table-column>
                <el-table-column label="操作" width="70">
                    <template slot-scope="scope">
                        <van-button @click="adminEdit('消费类型修改',scope.row,'800','400', 0)" size="mini" type="primary" style="width: 45px">
                            修改
                        </van-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
    </div>
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="static/axios.min.js"></script>
<script type="text/javascript" src="./static/vue"></script>
<script src="static/vant/vant.min.js"></script>
<script src="static/element/index.js"></script>
<script type="text/javascript">
    let vm = new Vue({
        el: '#app',
        data: {
            tableData: [],      //--具体人员信息表
            iiCount: '',
            tableHeightL: '',
            lock: false,
        },
        methods: {
            tableHeaderCellStyleL({row, column, rowIndex, columnIndex}) {
                let cellStyle1;

                cellStyle1 = "color: #eee;" +
                    "background:#4F4F4F;" +
                    "text-align:center;" +
                    "font-size:12px" +
                    "padding:0"

                return cellStyle1
            },

            tableCellStyleL({row, column, rowIndex, columnIndex}) {
                let cellStyle1;

                cellStyle1 = "text-align:center;" +
                    "padding:8px 1px 8px;" +
                    "font-size:12px;"
                return cellStyle1;
            },

            tableCellStyleYS({row, column, rowIndex, columnIndex}) {
                let cellStyle1;

                if (rowIndex === this.tongData.length - 1) {
                    cellStyle1 = "text-align:center;" +
                        "color:#00f;" +
                        "font-size:12px;" +
                        "padding:1px;"
                } else {
                    cellStyle1 = "text-align:center;" +
                        "font-size:12px;" +
                        "padding:1px;"
                }

                if (columnIndex > 3) {
                    cellStyle1 += "background:#ffffe1;"
                }

                return cellStyle1;
            },

            fInit() {
                this.currFang = ''
                this.curr = {}
                let self = this
                let params = new URLSearchParams();
                params.append('CMD', "AB");
                axios.post('/f_wscl/com2', params)
                    .then(function (res) {
                        //--db1左边表结构的树
                        let {db1, db2} = res.data
                        self.tableData = db1
                        self.iiCount = db2[0].VALUE01
                    })
                    .catch(function (error) {
                        layer.msg('网络异常错误', {icon: 1, time: 1000});
                    });
            },

            /*编辑和新增*/
            //--   jud=0修改    jud=1新增
            adminEdit(title, obj, w, h, jud) {
                if (title == null || title === '') {
                    title = false;
                }
                if (w == null || w === '') {
                    w = 800;
                }
                if (h == null || h === '') {
                    h = ($(window).height() - 50);
                }
                let ls_opid = "${sessionOpid}";

                layer.open({
                    type: 2,
                    area: [w + 'px', h + 'px'],
                    fix: false, //不固定
                    maxmin: false,
                    shade: 0.4,
                    title: title,
                    content: ['w_zxkj_xflxedit.jsp', 'no'],
                    success: function (layero, index) {
                        let body = layer.getChildFrame('body', index);//少了这个是不能从父页面向子页面传值的
                        //获取子页面的元素，进行数据渲染
                        body.contents().find("#VALUE01").val(obj.VALUE01);
                        body.contents().find("#VALUE11").val(ls_opid);
                        if (jud === 0) {
                            body.contents().find("#VALUE02").val(obj.VALUE02);
                            body.contents().find("#VALUE03").val(obj.VALUE03);
                            body.contents().find("#VALUE04").val(obj.VALUE04);
                            body.contents().find("#VALUE05").val(obj.VALUE05);
                            body.contents().find('#VALUE06' + obj.VALUE06).prop("checked", true);//这是子页面的单选按钮，让其选中
                            body.contents().find("#VALUE07").val(obj.VALUE07);
                            body.contents().find("#VALUE08").val(obj.VALUE08);
                            body.contents().find("#VALUE09").val(obj.VALUE09);
                            body.contents().find('#VALUE10' + obj.VALUE10).prop("checked", true);//这是子页面的单选按钮，让其选中
                        }
                    },
                });
            },
        },

        mounted() {
            this.fInit()
            window.fInit = this.fInit;
        },
        created() {
            let windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
            this.tableHeightL = windowHeight - 45;
        }
    });

</script>

</body>
</html>
